using System;
using System.ComponentModel;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;

namespace Vue_AspNetCore_Project.Models
{
    public class Invoice
    {
        [Key]
        [DatabaseGenerated(DatabaseGeneratedOption.Identity)]
        public string ID { get; set; }

        [Display(Name = "订单号")]
        public string OrderNo { get; set; }

        [Display(Name = "订单标题")]
        public string OrderTitle { get; set; }

        [Display(Name = "发票类型")]
        public string InvoiceType { get; set; }

        [Display(Name = "金额")]
         [Column(TypeName = "decimal(18,4)")]
        public decimal Amount { get; set; }

        [Display(Name = "开具日期")]
        [Required(ErrorMessage = "开具日期不能为空")]
        public DateTime RequiredDate { get; set; }

        [Display(Name = "打印日期")]
        public DateTime PrintDate { get; set; }

        [Display(Name = "税率")]
         [Column(TypeName = "decimal(18,4)")]
        public decimal TaxRate { get; set; }

        [Display(Name = "状态")]
        [DefaultValue(0)]
        public int Status { get; set; }

        [Display(Name = "递送方式")]
        [Required(ErrorMessage = "递送方式不能为空")]
        public string DeliveryPath { get; set; }

        [Display(Name = "快递号码")]
        public string DeliveryNo { get; set; }

        [Display(Name = "公司名字")]
        [Required(ErrorMessage = "公司名字不能为空")]
        public string CompanyName { get; set; }

        [Display(Name = "纳税人识别号")]
        [Required(ErrorMessage = "纳税人识别号不能为空")]
        public string TaxNo { get; set; }

        [Display(Name = "收件地址")]
        [Required(ErrorMessage = "收件地址不能为空")]
        public string PostAddress { get; set; }

        [Display(Name = "电话号码")]
        public string Tel { get; set; }

        [Display(Name = "开户行")]

        public string OpenBank { get; set; }

        [Display(Name = "银行账号")]

        public string BankAccount { get; set; }

        [Display(Name = "收件人")]
        [Required(ErrorMessage = "收件人不能为空")]
        public string Receiver { get; set; }

        [Display(Name = "收件人手机")]
        [Required(ErrorMessage = "收件人手机不能为空")]
        public string ReceiverPhone { get; set; }

        [Display(Name = "邮编")]

        public string PostCode { get; set; }

        [Required]
        [ForeignKey("User")]
        public int UserId { get; set; }

        public ApplicationUser User { get; set; }

        public DateTime CreatedTime { get; set; }
        public DateTime UpdatedTime { get; set; }
        [StringLength(100)]
        public string CreatedBy { get; set; }
        [StringLength(100)]
        public string UpdatedBy { get; set; }
    }
}